from anim_bone import *


analyzer = anim_cluster_analyzer(
    "data/",
    "KMedians",
    anim_distance.target_chord_dist,
    anim_distance.dist_func_square_combine,
    num_clusters=10,
)


apose_bones = {
    "Bip_L_Thigh": {
        "position": vector(0.2074575, -0.0120346, 0.1791355),
        "rotation": quaternion.euler(0.074, -178.889, -10.318),
    },
    "Bip_R_Thigh": {
        "position": vector(0.2074583, -0.01203552, -0.1791353),
        "rotation": quaternion.euler(-0.074, 178.889, -10.318),
    },
}


pose_driver = anim_pose_driver_datas("data/asset/TestPoseDriverDataForEval.asset")
pose_driver.init_target_data(list(apose_bones.keys()))
analyzer.extract_pose_driver_datas(apose_bones, pose_driver)
pose_driver.save_asset(
    "G:/UnityProject/KawaiiUnity/KawaiiUnityProj/Assets/ResForAssetBundles/Avatar/KawaiiPhysicsData/KawaiiPoseDriverAsset/TestPoseDriverDataForEval.asset"
)

# analyzer.analyze_pose()
# analyzer.analyze_cluster("Bip_L_Thigh")
# analyzer.analyze_data(rows=4, cols=6)
# anim_cluster_analyzer.custom_anim("data/config/dance.json")
